//
//  DemoDicLoop.m
//  ocdemo
//
//  Created by JIENING ZHANG on 2019/4/6.
//  Copyright © 2019 JIENING ZHANG. All rights reserved.
//

#import "DemoDicLoop.h"

@implementation DemoDicLoop

+ (void)demoLogic {
    
    NSDictionary *monthDic = @{
                               @"January" :     @(31),
                               @"February" :    @(28),
                               @"March" :       @(31),
                               @"April" :       @(30),
                               @"May" :         @(31),
                               @"June" :        @(30),
                               @"July" :        @(31),
                               @"August" :      @(31),
                               @"September" :   @(30),
                               @"October" :     @(31),
                               @"November" :    @(30),
                               @"December" :    @(31),
                               };
    
    for(NSString *key in monthDic) {
        NSLog(@"DemoDicLoop, for loop, %@ : %@", key, monthDic[key]);
    }
    
    [monthDic enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
        NSLog(@"DemoDicLoop, enumerate, %@ : %@", key, obj);
        if([key isEqualToString:@"February"]) {
            *stop = YES;
        }
    }];

}



@end
